<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
//    \Linganmin\Ding\HttpService::getInstance()->httpGet('http://www.baidu.com');
//    $res = \Linganmin\Ding\HttpService::getInstance()->httpGet('http://ifilm.linganmin.cn/api/lll');


//    \Linganmin\Ding\HttpService::getInstance()->httpGet('http://localhost:8889/test.php');
    return view('welcome');
});


Route::get('test', function () {
//    ding_notice('test2')
//        ->setTextMessage('这是测试')
//        ->send();

    $ding = new \Lingan\Ding\DingNotice([
        'robot_base_url' => env('DING_ROBOT_URL', 'https://oapi.dingtalk.com/robot/send'),
        'timeout'        => 2.0,
        'access_token'   => [
            'default' => env('DING_TOKEN', '59fe9a4213a4b83a523117f8235f9bf0f9a04c1c2ef6c10a7f7c91a27e7d4ca4'),// 默认
            'others'  => [ // 扩展更多token
                'test2' => env('XXX_TOKEN', '90b77dc0fb67e6a6f3c0bf3ebb0872b9a336152456598d10e289bd71c041914f'),
            ],
        ],
    ]);

    $ding->useRobot('test2')->getDingService()
        ->setTextMessage('这是测试啊测试')
        ->send();
});